﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Ord3a01
    {
		private string _plistid;
		private string _pdlistid;
		private double _bordqty;
		private double _ordqty;
		private double _pqty;
		private double _accqty;
		private double _preqty;
		private double _ppreqty;
		private double _accpreqty;
		private double _price;
		private double _ordprice;
		private double _cess;
		private double _ordamt;
		private double _accamt;
        private int? _listid;
		private string _dtlremark;
		private string _spno;
		private double _adjqty;
		private double _adjamt;
		private double _adjppqty;
		private double _sendamt;
		
        /// <summary>
        /// 订单主键标识
        /// </summary>
		public string Plistid
		{
			get { return _plistid;	 }
			set { _plistid=value;	}
		}
        /// <summary>
        /// 商品标识
        /// </summary>
		public string Pdlistid
		{
			get { return _pdlistid;	 }
			set { _pdlistid=value;	}
		}
        /// <summary>
        /// 起订数量
        /// </summary>
		public double Bordqty
		{
			get { return _bordqty;	 }
			set { _bordqty=value;	}
		}
        /// <summary>
        /// 订货数量
        /// </summary>
		public double Ordqty
		{
			get { return _ordqty;	 }
			set { _ordqty=value;	}
		}
        /// <summary>
        /// 配货数
        /// </summary>
		public double Pqty
		{
			get { return _pqty;	 }
			set { _pqty=value;	}
		}
        /// <summary>
        /// 实收数量
        /// </summary>
		public double Accqty
		{
			get { return _accqty;	 }
			set { _accqty=value;	}
		}
        /// <summary>
        /// 赠品数量
        /// </summary>
		public double Preqty
		{
			get { return _preqty;	 }
			set { _preqty=value;	}
		}
        /// <summary>
        /// 赠品配送
        /// </summary>
		public double Ppreqty
		{
			get { return _ppreqty;	 }
			set { _ppreqty=value;	}
		}
        /// <summary>
        /// 实收赠品
        /// </summary>
		public double Accpreqty
		{
			get { return _accpreqty;	 }
			set { _accpreqty=value;	}
		}
        /// <summary>
        /// 订购价
        /// </summary>
		public double Price
		{
			get { return _price;	 }
			set { _price=value;	}
		}
        /// <summary>
        /// 订单价
        /// </summary>
		public double Ordprice
		{
			get { return _ordprice;	 }
			set { _ordprice=value;	}
		}
        /// <summary>
        /// 税率
        /// </summary>
		public double Cess
		{
			get { return _cess;	 }
			set { _cess=value;	}
		}
        /// <summary>
        /// 订购金额
        /// </summary>
		public double Ordamt
		{
			get { return _ordamt;	 }
			set { _ordamt=value;	}
		}
        /// <summary>
        /// 收货金额
        /// </summary>
		public double Accamt
		{
			get { return _accamt;	 }
			set { _accamt=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public int? Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 明细备注
        /// </summary>
		public string Dtlremark
		{
			get { return _dtlremark;	 }
			set { _dtlremark=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Spno
		{
			get { return _spno;	 }
			set { _spno=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public double Adjqty
		{
			get { return _adjqty;	 }
			set { _adjqty=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public double Adjamt
		{
			get { return _adjamt;	 }
			set { _adjamt=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public double Adjppqty
		{
			get { return _adjppqty;	 }
			set { _adjppqty=value;	}
		}
        /// <summary>
        /// 发货金额
        /// </summary>
		public double Sendamt
		{
			get { return _sendamt;	 }
			set { _sendamt=value;	}
		}
		
		public static List<Ord3a01> GetOrd3a01ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Ord3a01> list = new List<Ord3a01>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Ord3a01 model = GetOrd3a01ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Ord3a01 GetOrd3a01ByDataRow(DataRow dr)
		{
			Ord3a01 model = new Ord3a01(); //实例化Ord3a01
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("plistid")&&!(dr["plistid"] is System.DBNull))  
				model.Plistid = ( string)dr["plistid"];
			if (dcc.Contains("pdlistid")&&!(dr["pdlistid"] is System.DBNull))  
				model.Pdlistid = ( string)dr["pdlistid"];
			if (dcc.Contains("bordqty")&&!(dr["bordqty"] is System.DBNull))  
				model.Bordqty = Convert.ToDouble(dr["bordqty"]);
			if (dcc.Contains("ordqty")&&!(dr["ordqty"] is System.DBNull))  
				model.Ordqty = Convert.ToDouble(dr["ordqty"]);
			if (dcc.Contains("pqty")&&!(dr["pqty"] is System.DBNull))  
				model.Pqty = Convert.ToDouble(dr["pqty"]);
			if (dcc.Contains("accqty")&&!(dr["accqty"] is System.DBNull))  
				model.Accqty = Convert.ToDouble(dr["accqty"]);
			if (dcc.Contains("preqty")&&!(dr["preqty"] is System.DBNull))  
				model.Preqty = Convert.ToDouble(dr["preqty"]);
			if (dcc.Contains("ppreqty")&&!(dr["ppreqty"] is System.DBNull))  
				model.Ppreqty = Convert.ToDouble(dr["ppreqty"]);
			if (dcc.Contains("accpreqty")&&!(dr["accpreqty"] is System.DBNull))  
				model.Accpreqty = Convert.ToDouble(dr["accpreqty"]);
			if (dcc.Contains("price")&&!(dr["price"] is System.DBNull))  
				model.Price = Convert.ToDouble(dr["price"]);
			if (dcc.Contains("ordprice")&&!(dr["ordprice"] is System.DBNull))  
				model.Ordprice = Convert.ToDouble(dr["ordprice"]);
			if (dcc.Contains("cess")&&!(dr["cess"] is System.DBNull))  
				model.Cess = Convert.ToDouble(dr["cess"]);
			if (dcc.Contains("ordamt")&&!(dr["ordamt"] is System.DBNull))  
				model.Ordamt = Convert.ToDouble(dr["ordamt"]);
			if (dcc.Contains("accamt")&&!(dr["accamt"] is System.DBNull))  
				model.Accamt = Convert.ToDouble(dr["accamt"]);
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( int)dr["listid"];
			if (dcc.Contains("dtlremark")&&!(dr["dtlremark"] is System.DBNull))  
				model.Dtlremark = ( string)dr["dtlremark"];
			if (dcc.Contains("spno")&&!(dr["spno"] is System.DBNull))  
				model.Spno = ( string)dr["spno"];
			if (dcc.Contains("adjqty")&&!(dr["adjqty"] is System.DBNull))  
				model.Adjqty = Convert.ToDouble(dr["adjqty"]);
			if (dcc.Contains("adjamt")&&!(dr["adjamt"] is System.DBNull))  
				model.Adjamt = Convert.ToDouble(dr["adjamt"]);
			if (dcc.Contains("adjppqty")&&!(dr["adjppqty"] is System.DBNull))  
				model.Adjppqty = Convert.ToDouble(dr["adjppqty"]);
			if (dcc.Contains("sendamt")&&!(dr["sendamt"] is System.DBNull))  
				model.Sendamt = Convert.ToDouble(dr["sendamt"]);
			
			return model;
		}
    }
}
